/*
 * Copyright (C) 2011, EADS France
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */

package xowl.store.rdf;

/**
 *
 * @author Laurent WOUTERS
 */
public class RDFBlankNode implements RDFSubjectNode {
    private int blankID;

    @Override public RDFNodeType getNodeType() { return RDFNodeType.Blank; }
    @Override public RDFGraph.Key _getKey() { return null; }
    @Override public RDFGraph.Literal _getLiteral() { return null; }
    @Override public int _getBlankID() { return blankID; }
    @Override public xowl.lang.owl2.AnonymousIndividual _getAnon() { return null; }

    RDFBlankNode(int id) {
        blankID = id;
    }
    
    @Override public int hashCode() { return blankID; }
    @Override public boolean equals(Object obj) {
        if (obj instanceof RDFBlankNode)  {
            RDFBlankNode node = (RDFBlankNode)obj;
            return (blankID == node.blankID);
        }
        return false;
    }
    
    @Override public String toString() { return "<blank>"; }
}
